<?php
session_start();
require_once('includes/functions.php');
connectlogin();
$user_name = $_SESSION['username'];
$skin = getskin($shopid);
$shopid = sitename($shopid);
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$shopid?></title>
<!-- Theme Section -->
<link rel="stylesheet" type="text/css" href="/themes/<?=$skin?>/style.css" />
<!-- JQuery Section -->
<link rel="stylesheet" type="text/css" href="includes/vader/jquery-ui-1.8.9.custom.css" />
<script type='text/javascript' src='includes/libs/jquery-1.4.4.min.js'></script>
<script type='text/javascript' src='includes/libs/jquery-ui-1.8.9.custom.min.js'></script>
<!-- Aion Section -->
<script src="http://static.yg.com/js/exsyndication.js" type="text/javascript"></script>  
</head>
<body>
<div id="header">
<div id="title">
<a href="index.php">
<h1>
<img src="/themes/<?=$skin?>/images/logo.png" title="<?=$shopid?>" alt="<?=$shopid?>" />
</h1>
</a>
</div>
</div>
<div id="main">
<div id="left">
<div id="left_stuff">
<?php if(isset($_SESSION['username'])) { 
?>
<div id="account">
<div id="welcome">
<a class="usercptxt" href="account.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />My Account</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="chars.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />My Characters</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="points.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />Donate</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="vote.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />Vote</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="shop.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />Game Shop</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="top.php"><img src="/themes/<?=$skin?>/images/char_ico.png" />Top Players</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />
<a class="usercptxt" href="/forum"><img src="/themes/<?=$skin?>/images/char_ico.png" />Community Forum</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />

<?php
		connectlogin();
		$username_s = mysql_real_escape_string($_SESSION['username']); 
		
		$sql = "SELECT * FROM account_data WHERE name = '$username_s'"; 
		$result = mysql_query($sql);
		$row = mysql_fetch_array($result);
		
		$user_level = $row['access_level'];
 if($user_level > 0){?>
<a class="usercptxt" href="admin"><img src="/themes/<?=$skin?>/images/char_ico.png" />Admin</a><br />
<img src="/themes/<?=$skin?>/images/sep.png" />

<?php } ?>
<a href="logout.php"><div id="logout" style="width:88px;"></div></a>
</div>
</div>
<?php
} else { 
		echo '
		<a href="sign_up.php">
         <div style="width: 210px;"> 
          <a href="sign_up.php"> 
            <div id="register">&nbsp;
            </div>
   	      </a>
		</div>
		</a>';
		
}
?>
</div>
</div>
<?php 
if(isset($_SESSION['username'])) { 
echo'<div id="right">';
}
else {
echo'<div id="right_login">';
}
?>